package com.xxxcompany.wordbook.dao;

import static org.junit.jupiter.api.Assertions.*;

import java.sql.SQLException;
import java.util.List;

import org.junit.jupiter.api.Test;

import com.xxxcompany.wordbook.entity.Word;

import junit.framework.TestCase;

class IWordDAOTest {

	IWordDAO wDAO = new WordDAOImpl();
	
	@Test
	void testInsert() throws SQLException {
		
		int result = wDAO.insert(new Word(-1,"hello","你好",1));
		
		TestCase.assertTrue(result==1);
		
	}

	@Test
	void testFindAll() throws SQLException {
//		fail("Not yet implemented");
		
		List<Word> words = wDAO.findAll();
		
		TestCase.assertNotNull(words);
		TestCase.assertTrue(words.size()>0);
	}

	@Test
	void testFindById() {
//		fail("Not yet implemented");
	}

	@Test
	void testDeleteById() {
//		fail("Not yet implemented");
	}

	@Test
	void testUpdateById() {
//		fail("Not yet implemented");
	}

}